//
//  FKRefundReasonCell.m
//  WanTao
//
//  Created by Macbook Pro on 2019/4/2.
//  Copyright © 2019 Macbook Pro. All rights reserved.
//

#import "FKRefundReasonCell.h"

@interface FKRefundReasonCell ()

@property (nonatomic, weak) UILabel *titleLabel;
@property (nonatomic, weak) UIImageView *iconView;

@end

@implementation FKRefundReasonCell

- (void)setupSubviews
{
    [super setupSubviews];
    self.selectionStyle = UITableViewCellSelectionStyleNone;
    
    UILabel *titleLabel = [UILabel fk_labelWithFont:fk_adjustFont(14) textColor:fkColor333333];
    [self.contentView addSubview:titleLabel];
    self.titleLabel = titleLabel;
    
    UIImageView *iconView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"bank_icon_select_n"]];
    [self.contentView addSubview:iconView];
    self.iconView = iconView;
    iconView.highlightedImage = [UIImage imageNamed:@"bank_icon_select_s"];
    
    [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.offset(12);
        make.centerY.offset(0);
    }];
    [iconView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.offset(-12);
        make.centerY.offset(0);
    }];
}

- (void)setData:(id)data
{
    [super setData:data];
    
    if ([data isKindOfClass:[NSDictionary class]]) {
        self.titleLabel.text = data[@"title"];
    }
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];
    
    self.iconView.highlighted = selected;
}

@end
